package com.my.security.test.domian;

import lombok.Data;
import org.springframework.security.core.GrantedAuthority;
import org.springframework.security.core.userdetails.UserDetails;

import java.util.Collection;
import java.util.List;

@Data
public class LoginUserInfo implements UserDetails {
    private int id;
    private String username;
    private String password;
    private String role;
    private List<GrantedAuthority> list;

    public LoginUserInfo(int id, String username, String password, List<GrantedAuthority> list) {
        this.id = id;
        this.username = username;
        this.password = password;
        this.list = list;
    }

    public LoginUserInfo(int id, String username, String password, String role, List<GrantedAuthority> list) {
        this.id = id;
        this.username = username;
        this.password = password;
        this.role = role;
        this.list = list;
    }

    @Override
    public Collection<? extends GrantedAuthority> getAuthorities() {
            return null;
    }

    @Override
    public boolean isAccountNonExpired() {
        return false;
    }

    @Override
    public boolean isAccountNonLocked() {
        return false;
    }

    @Override
    public boolean isCredentialsNonExpired() {
        return false;
    }

    @Override
    public boolean isEnabled() {
        return false;
    }
}
